<?php

class Report_model extends CI_Model
{
    public function getBetSummary($cond)
    {
        $this->db
            ->select('A.*')
            ->from('betSummary A')
            ->where($cond);

        $query = $this->db->get();
        $rt = array();

        if ($query->num_rows() > 0) {

            $rt = $query->result_array();
        }

        $query->free_result();
        return $rt;
    }

    public function updateBet($array, $cond)
    {
        $this->db->where($cond);
        return $this->db->update('betSummary', $array);
    }

    public function removeReport($id)
    {
        return $this->db->delete('betSummary', array(
            'id' => $id
        ));
    }

    public function addReport($arr)
    {
        return $this->db->insert('betSummary', $arr);
    }
}

